﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site_employees.Master" AutoEventWireup="true" CodeBehind="Promotion_user.aspx.cs" Inherits="Bus_proj.website.Promotion_user" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/textbox.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/Stylebuttoncss.css" rel="stylesheet" type="text/css" />
    
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 418px;
        }
        .style3
        {
            width: 418px;
            height: 23px;
        }
        .style4
        {
            height: 23px;
        }
        .style5
        {
            width: 207px;
            height: 23px;
        }
        .style6
        {
            height: 22px;
        }
        .style7
        {
            height: 22px;
        }
        .style10
        {
            height: 23px;
            width: 184px;
        }
        .style12
        {
            height: 23px;
            width: 213px;
        }
        .style16
        {
            width: 447px;
        }
        .style17
        {
            height: 22px;
            width: 213px;
        }
        .style18
        {
            height: 22px;
            width: 184px;
        }
        .style19
        {
            width: 414px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button3" EventName="Click" />
    </Triggers>
    <fieldset class="el03">
    <legend>แลกโปรโมชั่น</legend>
    <asp:Panel ID="Panel1" runat="server">
    <fieldset class="el02">
<table class="style1">
        <tr>
            <td align="right" class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td align="right" class="style2">
                <asp:Label ID="Label1" runat="server" Text="เลขรหัสประชาชน :"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBox1" runat="server" Height="24px" Width="158px" 
                    CssClass="textbox"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" class="style3">
            </td>
            <td class="style4">
                <asp:Button ID="Button1" runat="server" Height="34px" onclick="Button1_Click" 
                    Text="ค้นหา" Width="101px" CssClass="classname" />
            </td>
        </tr>
    </table>
    </fieldset>
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server" Visible="False">
    <fieldset class="el02">
    <legend>ข้อมูลสมาชิก</legend>
        <table class="style1">
            <tr>
                <td align="right" class="style5">
                </td>
                <td class="style12">
                </td>
                <td align="right" class="style10">
                    &nbsp;</td>
                <td class="style4">
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="right" class="style6">
                    <asp:Label ID="Label2" runat="server" Text="ชื่อ :"></asp:Label>
                </td>
                <td class="style17">
                    <asp:TextBox ID="TextBox2" runat="server" ReadOnly="True" CssClass="textbox"></asp:TextBox>
                </td>
                <td align="right" class="style18">
                    <asp:Label ID="Label4" runat="server" Text="ระยะทางสะสมคงเหลือ :"></asp:Label>
                </td>
                <td class="style7">
                    <asp:TextBox ID="TextBox4" runat="server" ReadOnly="True" Width="124px" 
                        CssClass="textbox"></asp:TextBox>
                    <asp:Label ID="Label5" runat="server" Text="กิโลเมตร"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" class="style6">
                    <asp:Label ID="Label3" runat="server" Text="นามสกุล :"></asp:Label>
                </td>
                <td class="style17">
                    <asp:TextBox ID="TextBox3" runat="server" ReadOnly="True" CssClass="textbox"></asp:TextBox>
                </td>
                <td align="right" class="style18">
                    <asp:Label ID="Label6" runat="server" Text="ระยะทางโปรโมชั่นที่เลือก :"></asp:Label>
                </td>
                <td class="style7">
                    <asp:TextBox ID="TextBox5" runat="server" ReadOnly="True" Width="123px" 
                        CssClass="textbox"></asp:TextBox>
                    <asp:Label ID="Label7" runat="server" Text="กิโลเมตร"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" class="style6">
                    &nbsp;</td>
                <td class="style17">
                    &nbsp;</td>
                <td align="right" class="style18">
                    <asp:Label ID="Label8" runat="server" Text="คงเหลือ :"></asp:Label>
                </td>
                <td class="style7">
                    <asp:TextBox ID="TextBox6" runat="server" Width="121px" CssClass="textbox"></asp:TextBox>
                    <asp:Label ID="Label9" runat="server" Text="กิโลเมตร"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="center" class="style6" colspan="4">
                    &nbsp;</td>
            </tr>
        </table>
     </fieldset>
        <asp:Panel ID="Panel3" runat="server">
        <fieldset class="el03">
        <legend>รายการโปรโมชั่น</legend>
            <table class="style1">
                <tr>
                    <td class="style19">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" 
                            BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                            DataSourceID="LinqDataSource1" ForeColor="Black" GridLines="Vertical">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField HeaderText="เลือก">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" />
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:CheckBox ID="CheckBox2" runat="server" />
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="promotion_item_id" HeaderText="รหัส" ReadOnly="True" 
                                    SortExpression="promotion_item_id" />
                                <asp:BoundField DataField="promotion_item_name" 
                                    HeaderText="รายละเอียดโปรโมชั่น" ReadOnly="True" 
                                    SortExpression="promotion_item_name" />
                                <asp:BoundField DataField="promotion_item_distance" 
                                    HeaderText="ระยะทางที่ใช้(กิโลเมตร)" ReadOnly="True" 
                                    SortExpression="promotion_item_distance" />
                            </Columns>
                            <EmptyDataTemplate>
                                <asp:CheckBox ID="CheckBox3" runat="server" />
                            </EmptyDataTemplate>
                            <FooterStyle BackColor="#CCCC99" />
                            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                            <RowStyle BackColor="#F7F7DE" />
                            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                            <SortedAscendingCellStyle BackColor="#FBFBF2" />
                            <SortedAscendingHeaderStyle BackColor="#848384" />
                            <SortedDescendingCellStyle BackColor="#EAEAD3" />
                            <SortedDescendingHeaderStyle BackColor="#575357" />
                        </asp:GridView>
                        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                            ContextTypeName="Bus_proj.DataClasses1DataContext" EntityTypeName="" 
                            Select="new (promotion_item_id, promotion_item_name, promotion_item_distance)" 
                            TableName="Table_promotion_items" 
                            Where="promotion_item_status == @promotion_item_status">
                            <WhereParameters>
                                <asp:Parameter DefaultValue="true" Name="promotion_item_status" 
                                    Type="Boolean" />
                            </WhereParameters>
                        </asp:LinqDataSource>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="style19">
                        <asp:Button ID="Button2" runat="server" 
                            OnClientClick="return confirm('ยืนยันการเลือกสินค้า')" Height="35px" onclick="Button2_Click" 
                            Text="ตกลง" Width="92px" CssClass="classname" />
                    </td>
                    <td>
                        <asp:Button ID="Button3" runat="server" Height="35px" onclick="Button3_Click" 
                            Text="ยกเลิก" Width="98px" CssClass="classname" />
                    </td>
                </tr>
            </table>
        </fieldset>
        </asp:Panel>
    </asp:Panel>
    </fieldset>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
